#include<bits/stdc++.h>
#define M 60
#define N 110000
#define eps 1e-7
#define inf 1e9+7
#define db double
#define ll long long
#define ldb long double
using namespace std;
inline ll read()
{
	char ch=0;
	ll x=0,flag=1;
	while(!isdigit(ch)){ch=getchar();if(ch=='-')flag=-1;}
	while(isdigit(ch)){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*flag;
}
struct node
{
	ll size,f[M];
	ll query()
	{
		ll ans=0;
		for(ll i=60;i>=0;i--)if(f[i]&&!(1ll<<i&ans))ans^=f[i];
		return ans;
	}
	void insert(ll x)
	{
		for(ll i=60;i>=0;i--)if(1ll<<i&x)
		{
			if(f[i])x^=f[i];
			else return (void)(size++,f[i]=x);
		}
	}
}S;
int main()
{
	ll n=read();
	for(ll i=1;i<=n;i++)S.insert(read());
	printf("%lld",S.query());
	return 0;
}
